package com.atguigu.gmall.user.rpc;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.common.util.AuthUtil;
import com.atguigu.gmall.model.to.UserAuthTo;
import com.atguigu.gmall.model.user.UserAddress;
import com.atguigu.gmall.user.service.UserAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author A
 * @version 1.0
 * @description: TODO
 * @date 2025/9/12 17:36
 */
@RestController
@RequestMapping("/rpc/inner")
public class RpcUserController {
    @Autowired
    UserAddressService userAddressService;
    @GetMapping("/userAddress")
    public List<UserAddress> userAddress() {
        UserAuthTo authTo = AuthUtil.getAuthTo();
        List<UserAddress> userAddressList =userAddressService.getUserAddressList(authTo.getUserId());
        return userAddressList;
    }
}
